from appium import webdriver
from appium.webdriver.common.appiumby import By
from time import sleep

desired_caps = {}# {}定义空字典
desired_caps['platformName']='Android'
desired_caps['platformVersion'] = '7'
desired_caps['deviceName'] = '127.0.0.1:62001'
desired_caps['app'] = r'E:\nmon\apk\kaoyanbang.apk' # pc端的apk包所在的路径
desired_caps['appPackage'] = r'com.tal.kaoyan'
desired_caps['appActivity'] = r'com.tal.kaoyan.ui.activity.SplashActivity'
desired_caps['noReset'] = False

driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',desired_caps)
driver.implicitly_wait(10)
sleep(3)
# 进入初试界面，点击取消
driver.find_element(By.ID,'android:id/button2').click()
# 点击跳过
driver.find_element(By.ID,'com.tal.kaoyan:id/tv_skip').click()

driver.quit()
